package com.smart.manager.pop.entities.models;

import com.smart.common.entities.core.BaseLongModel;
import com.smart.manager.member.entities.views.MemberView;
import com.smart.manager.pop.entities.enums.CDKState;
import com.smart.manager.pop.entities.enums.ExchangeKind;
import io.ebean.annotation.DbJson;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import java.math.BigDecimal;
import java.time.LocalDateTime;


/**
 * 渠道代理
 *
 * @author Administrator
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@Accessors(chain = true)
public class PopDisExchange extends BaseLongModel {

    @ApiModelProperty(value = "兑换码")
    private String redeemCodes;

    @ApiModelProperty(value = "使用时间")
    private LocalDateTime useTime;

    @ApiModelProperty(value = "使用账号")
    @JoinColumn(name = "use_member", referencedColumnName = "id")
    @ManyToOne
    private MemberView useMember;

    @ApiModelProperty(value = "兑换码")
    private CDKState state;

    @ApiModelProperty(value = "使用方式")
    private ExchangeKind kind;

    @ApiModelProperty(value = "兑换内容")
    @DbJson
    private Object includeContent;

    @ApiModelProperty(value = "数量")
    private BigDecimal proportion;

}
